<?php echo $this->Html->script(array('ckeditor/ckeditor','ckeditor/adapters/jquery'));?>
<script type="text/javascript">
jQuery(function(){
	var config = {
			toolbar:[
						['Source','Find','Replace', '-','Undo','Redo'],['UIColor'],['sj56image'],
						['Bold', 'Italic','Underline','Strike','Subscript','Superscript' ],
						['Link','Unlink','Anchor' ],
					    [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv',
					    '-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], '/',
						[ 'Styles','Format','Font','FontSize' ], ['TextColor','BGColor'],
						[ 'Maximize']
					],
			height:450
		};
	jQuery('.textarea textarea').ckeditor(config);
    $( "#ArticlePublish" ).datepicker({
        defaultDate: '',
        changeMonth: true,
        numberOfMonths: 1,
        dateFormat:'yy-mm-dd'
    });
});
</script>
<h1><?php echo $this->Html->image('bootstrap/posts.png')?>添加资讯</h1>
<div class="bloc">
	<div class="title">
		<?php echo $this->element('admin/bread')?>
	</div>
    <div class="content">
		<?php echo $this->Form->create('Article'); ?>
		<table style = 'width:100%'>
			<tr>
				<td width = "50%">
					<?php 
						echo $this->Form->input('sys_website_id',array('label'=>'所属站点','style'=>'z-index: -1;','options'=>$SysWebsite,'default'=>$this->Session->read('SITEID')));
					?>
				</td>
				<td width = "50%">
					<?php 
						echo $this->Form->input('article_cate_id');
						echo $this->Form->input('user_id',array('type'=>'hidden','default'=>$Auth['id']));
					?>
				</td>
			</tr>
			<tr>
				<td colspan =2>
					<?php 
					echo $this->element('SeoMeta.seometa');
					?>
				</td>
			</tr>
			<tr>
				<td>
					<?php echo $this->Form->input('title',array('label'=>'资讯标题')); ?>
				</td>
				<td>
				<?php 
					echo $this->Form->input('publish',array('default'=>date('Y-m-d'),'label'=>'发布时间','class'=>'datepicker datetimepicker','type'=>'text'));
					?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
						echo $this->Form->input('auth',array('label'=>'原稿作者'));
					?>
				</td>
				<td>
					<?php 
						echo $this->Form->input('resource',array('label'=>'原稿来源'));
					?>
				</td>
			</tr>
			<tr>
				<td colspan =2>
					<?php 
					echo $this->Form->input('content',array('label'=>'资讯内容'));
					?>
				</td>
			</tr>
			<tr>
				<td colspan =2>
					<?php
					echo $this->Form->input('tags',array('default'=>'','label'=>'Tag(多个标签请用英文逗号","分隔)','style'=>'width:90%'));
					echo $this->Form->input('count_view',array('type'=>'hidden','default'=>0));
					echo $this->Form->input('sort',array('default'=>100,'label'=>'排序'));
					echo $this->Form->input('recmd_index',array('type'=>'checkbox','default'=>0,'label'=>'推荐到首页'));
					echo $this->Form->input('recmd_hot',array('type'=>'checkbox','default'=>0,'label'=>'热门'));
					echo $this->Form->input('sort_top',array('type'=>'checkbox','default'=>0,'label'=>'置顶'));
					echo $this->Form->input('enable',array('type'=>'checkbox','default'=>1,'label'=>'启用'));
				?>
				</td>
			</tr>
			<tr>
				<td colspan =2>
				<?php echo $this->Form->submit('提交')?>
				</td>
			</tr>
			
		</table>
		<?php echo $this->Form->end(); ?>
	</div>
</div>
<div style = 'display:none'>
<?php 	echo $this->element('Album.ajaxUploadForm',array('pluginid'=>'sj56image','upload'=>true,'list'=>true,'album_id'=>3,'userCallback'=>'editorPluginCallback'));?>
</div>